<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>字面量定义类和使用</title>
</head>
<body>

</body>
<script>
    //定义Person类
    let Person = {
        name : "张三",
        age : 28,
        hobby : ["听课","吃饭"],

        eat : function () {
            document.write("吃火锅");
        }
    };

    //使用Person
    document.write(Person.name + "," + Person.age + "," + Person.hobby[0] + "," + Person.hobby[1] + "<br>");
    Person.eat();
</script>
</html>